﻿@using Nop.Services.Customers;
@using Nop.Web.Framework.UI;
@using Nop.Core;
@using Telerik.Web.Mvc.UI;

@{
    var currentCustomer = this.WorkContext.CurrentCustomer;

    //resources
    Html.AppendCssFileParts("~/Content/css/logistics.mobile.css");
    Html.AppendCssFileParts("~/Content/css/normalize.css");
    Html.AppendScriptParts("~/Scripts/jquery.min.js");
    //page title
    string pageTitle = "";
    if (!String.IsNullOrWhiteSpace(ViewBag.Title))
    {
        pageTitle = ViewBag.Title + " / ";
    }
    pageTitle += "SpotsHUB -SpotsExpress: CHEAPER, BETTER, FASTER";
    
    //success messages
    var successMessages = new List<string>();
    if (TempData[string.Format("nop.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(TempData[string.Format("nop.notifications.{0}", NotifyType.Success)] as IList<string>);
    }
    if (ViewData[string.Format("nop.notifications.{0}", NotifyType.Success)] != null)
    {
        successMessages.AddRange(ViewData[string.Format("nop.notifications.{0}", NotifyType.Success)] as IList<string>);
    }


    //error messages
    var errorMessages = new List<string>();
    if (TempData[string.Format("nop.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(TempData[string.Format("nop.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
    if (ViewData[string.Format("nop.notifications.{0}", NotifyType.Error)] != null)
    {
        errorMessages.AddRange(ViewData[string.Format("nop.notifications.{0}", NotifyType.Error)] as IList<string>);
    }
}
<!DOCTYPE html>
<html>
<head>
    <title>@pageTitle</title>
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="pragma" content="no-cache" />
    <style>
        @@-ms-viewport { width: device-width; }
        @@-o-viewport { width: device-width; }
        @@viewport { width: device-width; }
    </style>
    @Html.NopCssFiles(this.Url, ResourceLocation.Head)
    @Html.NopScripts(this.Url, ResourceLocation.Head)
    @StackExchange.Profiling.MiniProfiler.RenderIncludes()
</head>
<body>
    <header>
        <div class="logout">
            @if (User.Identity.IsAuthenticated)
            {
                <a id="logout-button" href="@Url.RouteUrl("Logout")">Logout</a>
                <div>Hello, @User.Identity.Name</div>
                
            }
        </div>
    </header>
    <div class="renderbody" style="-webkit-text-size-adjust: none; font-size: medium; width: 100%">
        @foreach (var message in successMessages)
        {
            <div class="messageBox messageBoxSuccess">
                @message
            </div>
            <div class="clear">
            </div>
        }
        @foreach (var message in errorMessages)
        {
            <div class="messageBox messageBoxError">
                @message
            </div>
            <div class="clear">
            </div>
        }
        <article>
            @RenderBody()
        </article>
    </div>
</body>
</html>
